home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20030409-20031118 / 000253_fdc@sesame.cc.columbia.edu_Sun Aug 31 13:06:42 EDT 2003.msg < prev    next >
Text File  |  2020-01-01  |  7KB  |  153 lines

  1. Article: 14493 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!news-not-for-mail
  3. From: fdc@sesame.cc.columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.os.linux.misc,comp.protocols.kermit.misc
  5. Subject: Re: Sending a file via telnet
  6. Date: 31 Aug 2003 13:05:53 -0400
  7. Organization: Columbia University
  8. Lines: 136
  9. Message-ID: <bit9th$64m$1@sesame.cc.columbia.edu>
  10. References: <pan.2003.08.29.17.58.39.555981@shaw.ca> <bio6ej$t6a$1@sesame.cc.columbia.edu> <pan.2003.08.29.22.42.30.692266@shaw.ca>
  11. NNTP-Posting-Host: sesame.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1062349554 8354 128.59.59.56 (31 Aug 2003 17:05:54 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 31 Aug 2003 17:05:54 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.os.linux.misc:604842 comp.protocols.kermit.misc:14493
  16.  
  17. In article <pan.2003.08.29.22.42.30.692266@shaw.ca>,
  18. Lloyd Sumpter <lsumpter@shaw.ca> wrote:
  19. : On Fri, 29 Aug 2003 14:36:03 +0000, Frank da Cruz wrote:
  20. : > In article <pan.2003.08.29.17.58.39.555981@shaw.ca>,
  21. : > Lloyd Sumpter <lsumpter@shaw.ca> wrote:
  22. : > :    I'm using Linux (Mandrake 9.0) to access a device that only
  23. : > : communicates using Telnet. I need to send a file (Motorola
  24. : > : S-records). How do I send a file with telnet? I tried using cut-n-paste
  25. : > : from another window: seemed to work but was SLOW and cumbersome - this
  26. : > : file is 2000 lines long!
  27. : > : 
  28. : > Use C-Kermit as the Telnet client:
  29. : > 
  30. : >   http://www.columbia.edu/kermit/ckermit.html
  31. : > 
  32. : > How to send the file depends on what protocols are supported by the
  33. : > device.  Choices include:
  34. : > 
  35. : >  . Kermit protocol (straightforward, built into C-Kermit)
  36. : >  . X- Y- or Zmodem (can be invoked by C-Kermit as an external protocol)
  37. : >  . "ASCII" (use C-Kermit's TRANSMIT command for this)
  38. : > 
  39. : > I suspect "ASCII" is what they use.  Type "help transmit" at the 
  40. : > C-Kermit prompt to find out about it.
  41. : > 
  42. : > - Frank
  43. : That just might work - thanks!
  44. It will work.  Kermit has been used to send files consisting of S-records
  45. via "ASCII" protocol to devices that support only serial-port or Telnet
  46. access for 20 years -- which is to say we have some experience with this.
  47.  
  48. Kermit's TRANSMIT command is a transport-independent way of sending files
  49. a line at a time without error detection or correction, to be used in
  50. cases like this one where no higher level protocol is available (FTP,
  51. HTTP, Kermit, XYZmodem, etc).  It has all sorts of options to let you control
  52. handshaking, pacing, and whatnot.  Again, HELP TRANSMIT explains the
  53. TRANSMIT command, and HELP SET TRANSMIT explains the options and settings.
  54.  
  55. Obviously this is less desirable than an error-detecting-and-correcting
  56. file transfer protocol, but when you have no other choice this is what
  57. you have to do.  Meanwhile, the S-records themselves contain framing and
  58. checksum information, so after you have uploaded them, you still get
  59. error detection when you actually try to *use* the S-records.
  60.  
  61. A typical setup might be:
  62.  
  63.   set host <ip-name-or-address> [ <port> ]
  64.   if fail exit 1
  65.   
  66. There might be some additional wrinkles depending on which TCP port
  67. you connect to and whether (and to what degree) it supports, uses, requires,
  68. or misimplements Telnet protocol -- all of this can be handled.  If you
  69. have problems or questions, read the "help set host" text or send email to
  70. kermit-support@columbia.edu.
  71.  
  72. At this point if any dialog is required to log in or set up the transfer,
  73. do it here using INPUT, OUTPUT, and IF FAIL commands as explained here:
  74.  
  75.   http://www.columbia.edu/kermit/ckscripts.html
  76.  
  77. Then to upload the file:
  78.  
  79.   set transmit prompt 0   ; explained below
  80.   transmit blah.hex       ; send the file
  81.   close                   ; close the connection
  82.  
  83. The "transmit prompt" tells Kermit what to wait for after sending each
  84. line before it sends the next line; 0 means don't wait for anything.
  85. Normally it waits for Linefeed (10), because that's what you get in
  86. situations where the receiver of the transmission echoes incoming lines.
  87.  
  88. Another consideration is how you tell the receiver that the transmission
  89. is finished.  I'm assuming you just close the connection (as shown above).
  90. You can also have Kermit send a character or string of your choice, that
  91. you can specify with the "set transmit eof" command, e.g. \4 for Ctrl-D,
  92. which you would use if the receiver was the Unix 'cat' command, or \26 for
  93. Ctrl-Z, etc.
  94.  
  95. Once you have this working, you can also use it for the serial port
  96. connection; just replace the "set host" command with something like:
  97.  
  98.   set modem type none
  99.   set flow rts/cts    ; or xon/xoff, whichever the device uses
  100.   set port /dev/ttyS0 ; or whatever
  101.   if fail exit 1
  102.   set speed 38400     ; or whatever
  103.  
  104. Readers really should take a look at Kermit when trying to puzzle out how
  105. to do any moderately complicated or obscure communications task, especially
  106. if it is to be automated.  Kermit does:
  107.  
  108.   serial ports
  109.   modems
  110.   telnet        (clear-text)
  111.   telnet        (secure: Kerberized or SSL/TLS or SRP)
  112.   ftp           (clear-text)
  113.   ftp           (secure: Kerberized or SSL/TLS or SRP)
  114.   http 1.1      (clear text)
  115.   http 1.1      (SSL/TLS)
  116.  
  117. and it can also act as a scripting and file-transferring front end for
  118. your SSH client.
  119.  
  120. Procedures coded for Kermit are transport independent (except for the
  121. part where you open the connection) and platform independent: the same
  122. procedure runs on all varieties of Unix, as well as on Windows, VMS and
  123. other operating systems where the many Unix-specific tools suggested by
  124. other posters tend not to be available.
  125.  
  126. C-Kermit was included in the Red Hat 9 distribution, although I discovered
  127. recently that it does not get insalled by default and it's not obvious how
  128. to get it off the CD.  No worries, it's easy to download from Columbia U:
  129.  
  130.   ftp://kermit.columbia.edu/kermit/archives/cku209.tar.gz
  131.  
  132. Put it a fresh directory and:
  133.  
  134.   gunzip cku209.tar.gz
  135.   tar xvf cku209.tar
  136.   make linux
  137.   mv ./wermit /usr/local/bin/kermit
  138.  
  139. and, if it is to be used for dialing out, give it the same owner, group,
  140. and permissions as minicom.  Detailed installation instructions are here:
  141.  
  142.   http://www.columbia.edu/kermit/ckuins.html
  143.  
  144. Or if you prefer, there's an RPM here:
  145.  
  146.   http://www.redhat.com/swr/i386/ckermit-8.0.206-0.6.i386.html
  147.  
  148. (but this version is slightly behind the one at Columbia).
  149.  
  150. - Frank
  151.